 /**
 ****************************************************************
 * @file define.h
 *
 * @brief  define宏控制和部分变量定义
 *
 * @author 
 *
 * 
 ****************************************************************
 */ 
#ifndef DEFINE_H
#define DEFINE_H


/*
 * VESRION DESCRIPTION
 ****************************************************************
 */	
#ifdef __cplusplus
extern "C" {
#endif

#define VERSION "1.0.0"

#define INT_USE_CHECK_REG 			1		//中断使用查询07寄存器的irq bit

#define NFC_DEBUG					0		// printf打印控制开关

#define POWERON_POLLING 			0		//上电即开始自动A/B polling	

#define DIFFERENCE_CHANNEL			1		//默认值为差分电路，值为1

/*********************系统时钟配置************************/
#define FOSC 				22118400ul

#define BAUD 				115200

typedef unsigned long 		u32;
typedef unsigned short		u16;
typedef unsigned char 		u8;
typedef unsigned char 		bool;
typedef unsigned long 		tick;

typedef unsigned long 		U32;
typedef unsigned short 		U16;
typedef unsigned char 		U8;

typedef float float32_t;

#define make_packet(...)

#define DATA				
#define IDATA				
#define PDATA				
#define XDATA				
#define CODE				
#define REENTRANT			

#define FALSE 				0
#define TRUE				1

#define BIT0				0x01
#define BIT1				0x02
#define BIT2 				0x04
#define BIT3 				0x08
#define BIT4 				0x10
#define BIT5 				0x20
#define BIT6 				0x40
#define BIT7 				0x80


//PC机软件与下位机软件通信命令字
#define COM_PKT_CMD_READ_REG 					0x01
#define COM_PKT_CMD_WRITE_REG					0x02
#define COM_PKT_CMD_LOAD_PASSWORD_A				0x03
#define COM_PKT_CMD_LOAD_PASSWORD_B				0x04
#define COM_PKT_CMD_READ_CARD					0x05
#define COM_PKT_CMD_WRITE_CARD					0x06
#define COM_PKT_CMD_INIT_BLOCK					0x07
#define COM_PKT_CMD_PLUS_ONE_BLOCK				0x08
#define COM_PKT_CMD_DECREASE_ONE_BLOCK			0x09
#define COM_PKT_CMD_CARD_NUMBER					0x0A	//卡号
#define COM_PKT_CMD_CARD_CONTENT				0x0B	//块内容	
#define COM_PKT_CMD_SWITCH_SPI					0x0C	//普通spi和射频spi切换
#define COM_PKT_CMD_QUERY_MODE					0x0D	//是否是手动模式，而不是自动寻卡模式
#define COM_PKT_CMD_CHIP_RESET      			0x0E    //软复位数字芯片
#define COM_PKT_CMD_CARD_TYPE					0x0F
#define COM_PKT_CMD_REQ_SELECT					0x10
#define COM_PKT_CMD_HALT						0x11 	//发送Halt指令
#define COM_PKT_CMD_STATISTICS					0x12 	//统计信息
#define COM_PKT_CMD_LPCD						0x13 	//LPCD 功能
#define COM_PKT_CMD_AUTO_READ_WRITE 			0x14 	//reqa后自动进行读写卡
#define COM_PKT_CMD_SOC2014_FIX					0x15 	
#define COM_PKT_CMD_LPCD_CONFIG_TEST 			0x16 	//测试LPCD功能
#define COM_PKT_CMD_LPCD_CONFIG_TEST_STOP 		0x17
#define COM_PKT_CMD_POWERON						0x18
#define COM_PKT_CMD_POWERDOWN					0x19
#define COM_PKT_CMD_AUTO_READ_TYPEB_ID			0x1A	//在自动询卡时，寻到TypeB时自动读取其ID
#define COM_PKT_CMD_POWER_SWITCH_ON				0x1B
#define COM_PKT_CMD_POWER_SWITCH_OFF			0x1C
#define COM_PKT_CMD_TYPEC_FELICA_POLLING		0x3F
#define	COM_PKT_CMD_ISO15693_POLLING			0x44

#ifdef __cplusplus
}
#endif

#endif
